<? $this->headTitle($this->product->manufacturer_name . ' ' . $this->product->name . ' | ' . $this->shopName . ' - ' . $this->translate($this->shopTitle)); ?>
<? $this->headMeta()->appendName('keywords', $this->translate('online store') . ', ' . mb_strtolower($this->translate($this->shopCity), 'utf8') . ', ' . mb_strtolower($this->product->manufacturer_name, 'utf8') . ', ' . $this->product->name . ', ' . $this->product->mpn) ?>
<? $this->headMeta()->appendName('description', $this->product->manufacturer_name . ' ' . $this->product->name . ' (' . $this->product->mpn . '). ' . $this->translate($this->shopTitle) . '. ' . $this->translate('Sale, shipment, warranty.')); ?>
<? $this->headLink()->appendStylesheet('/css/product.css') ?>
<div class="breadcrumb">
    <?= $this->Breadcrumb($this->product) ?>
</div>
<div class="product">
    <h1><?= $this->escape($this->product->manufacturer_name) ?>
        <?= $this->escape($this->product->name) ?>
        (<?= $this->escape($this->product->mpn) ?>)
    </h1>
    <table>
        <tr>
            <td class="product-picture">
                <img src="<?= $this->product->low_pic_url ?>"/>
            </td>
            <td class="product-info">
                <div>
                    <b><?= $this->translate('Category'); ?>:</b> 
                    <a href="/<?= $this->language ?>/catalog/<?= $this->product->category_id ?>"/><?= $this->escape($this->product->category_name) ?></a></div>
                <div>
                    <b><?= $this->translate('Manufacturer'); ?>:</b>
                    <?= $this->escape($this->product->manufacturer_name) ?>
                </div>
                <div>
                    <b> <?= $this->translate('Name'); ?>:</b> 
                    <?= $this->escape($this->product->name) ?>
                </div>
                <div>
                    <b> <?= $this->translate('Model'); ?>:</b> 
                    <?= $this->escape($this->product->mpn) ?>
                </div>
                <? if ($this->product->price): ?>
                    <div class="price">
                        <b><?= $this->translate('Price'); ?></b>
                        <?= $this->product->price ?>&nbsp;<?= $this->translate('grn') ?>
                    </div>
                    <? if ($this->shopMode): ?>
                        <form class="buy" method="post" action="/<?= $this->language ?>/cart">
                            <input type="hidden" name="product" value="<?= $this->product->id ?>"/>
                            <input type="submit" value="<?= $this->translate('Buy') ?>"/>  
                        </form>
                    <? endif ?>
                <? endif ?>
            </td>
        </tr>
    </table>
</div>
<? if ($this->productFeatureGroups): ?>
    <h2><?= $this->translate('Product features'); ?></h2>
    <div class="product-features">
        <?
        $featureGroupIndex = 0;
        $featureIndex = 0;
        $featureGroupsKeys = array_keys($this->productFeatureGroups);
        $featureGroupsValues = array_values($this->productFeatureGroups);
        ?>
        <div class="product-features-column">
            <? while ($featureIndex < $this->productFeaturesCount / 2): ?>
                <div>
                    <h3><?= $this->escape($featureGroupsKeys[$featureGroupIndex]) ?></h3>
                    <? foreach ($featureGroupsValues[$featureGroupIndex] as $feature): ?>
                        <div><?= $this->escape($feature->name) ?>:
                            <span class="feature-value">
                                <?= $this->escape($feature->value); ?>
                            </span>
                            <? $featureIndex++ ?>
                        </div>
                    <? endforeach; ?>
                    <? $featureIndex++ ?>
                </div>
                <? $featureGroupIndex++ ?>
            <? endwhile; ?>
        </div>
        <div class="product-features-column">
            <? while ($featureIndex < $this->productFeaturesCount): ?>
                <div>
                    <h3><?= $this->escape($featureGroupsKeys[$featureGroupIndex]) ?></h3>
                    <? foreach ($featureGroupsValues[$featureGroupIndex] as $feature): ?>
                        <div><?= $this->escape($feature->name) ?>:
                            <span class="feature-value"><?= $this->escape($feature->value); ?></span>
                            <? $featureIndex++ ?>
                        </div>
                    <? endforeach; ?>
                    <? $featureIndex++ ?>
                </div>
                <? $featureGroupIndex++ ?>
            <? endwhile; ?>
        </div>
    </div>
<? endif; ?>
